﻿using DataAccess;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Administratie_lib
{
    public class Bestelling : I_Orders
    {
        Database database = new Database();
        public void Bewerk() { }
        public void Toevoegen() { }
        public void Verwijderen() { }
        public DataTable Zoek(int order = 0)
        {
            if(order != 0)
                return database.Select("SELECT *, status.omschrijving StatusOmschrijving, Bestelling.Id Bestel_id FROM Product, ProductOrder, Bestelling, Status WHERE Product.Id = ProductOrder.ProductId AND Bestelling.Id = ProductOrder.Orderid AND Status.id = Bestelling.statusId AND ProductOrder.OrderId =" + order);
            else
                return database.Select("SELECT * FROM Bestelling WHERE statusId != 3");
        }
    }
}
